package com.rc.web.test;

import com.rc.common.constant.CommentType;
import com.rc.common.model.ImageModel;
import com.rc.common.util.JsonUtil;
import com.rc.common.util.RabbitMqHelper;
import com.rc.common.util.RedisHelper;
import com.rc.pojo.po.Comment;
import com.rc.web.mapper.*;
import com.rc.web.service.FarmService;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cache.CacheManager;
import org.springframework.data.redis.core.RedisTemplate;

import java.util.Arrays;
import java.util.List;

@SpringBootTest
@Slf4j
public class T {
    @Autowired
    FarmService farmService;

    @Autowired
    FarmMapper farmMapper;

    @Autowired
    CommentMapper commentMapper;

    @Autowired
    RedisHelper redisHelper;

    @Autowired
    RedisTemplate redisTemplate;

    @Autowired
    private CacheManager cacheManager;

    @Autowired
    ActivityMapper activityMapper;

    @Autowired
    OrderMapper orderMapper;

    @Autowired
    AreaMapper areaMapper;

    @Autowired
    RabbitMqHelper mqHelper;


    @Test
    public void farmTest(){
//        farmMapper.selectByLocation(120.210792,30.246026,110817);
        List<Long> ids = Arrays.asList();
        List<Comment> commentList = commentMapper.selectByItemIds(ids, CommentType.FARM,3);
        System.out.println(commentList);


    }
    @Test
    public void commtentTest(){
        long l = commentMapper.selectRecommended(0, 0);
    }

    public static void main(String[] args) {
        String json = "{\"name\":\"111\",\"url\":\"1111\"}";
        ImageModel object = JsonUtil.toObj(json,ImageModel.class);
        System.out.println(object.getClass());
    }

    @Test
    public void redisTest(){

    }



}
